package org.wdcode.shop.po;

import java.io.Serializable;

import org.wdcode.back.po.BaseBackCreateDateEntityBean;
import org.wdcode.common.tools.Conversion;
import org.wdcode.common.util.CommonUtil;
import org.wdcode.shop.helper.LeaveWordHelper;

/**
 * 回复留言实体
 * @author WD
 * @since JDK6
 * @version 1.0 2009-11-23
 */
public final class RevertWord extends BaseBackCreateDateEntityBean implements Serializable {
	// 序列化ID
	private static final long	serialVersionUID	= -7883068374645379082L;
	// 留言ID
	private Integer				leaveId;
	// 回复内容
	private String				content;

	// 留言实体
	private LeaveWord			leaveWord;

	/**
	 * 设置留言实体
	 * @param leaveId 留言ID
	 * @return 留言实体
	 */
	public LeaveWord setLeaveWord(Integer leaveId) {
		return leaveWord = LeaveWordHelper.getHelper().get(Conversion.toInt(leaveId));
	}

	/**
	 * 获得留言实体
	 * @return 留言实体
	 */
	public LeaveWord getLeaveWord() {
		return CommonUtil.isEmpty(leaveWord) ? setLeaveWord(leaveId) : leaveWord;
	}

	/**
	 * 获得留言ID
	 * @return 留言ID
	 */
	public Integer getLeaveId() {
		return leaveId;
	}

	/**
	 * 设置留言ID
	 * @param leaveId 留言ID
	 */
	public void setLeaveId(Integer leaveId) {
		this.leaveId = leaveId;
	}

	/**
	 * 获得回复内容
	 * @return 回复内容
	 */
	public String getContent() {
		return this.content;
	}

	/**
	 * 设置回复内容
	 * @param content 回复内容
	 */
	public void setContent(String content) {
		this.content = content;
	}
}